#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int a = 0;
	int sn = 0;
	int sum = 0;
	int num = 0;
	int  cishu = 0;
	scanf("%d", &a);
	scanf("%d", &cishu);
	
		for (int i = 0; i <cishu; i++)
		{
			sn += a;
			a *= 10;
			sum += sn;
			num += sum;
		}
		

	
	printf("%d", num);
	return 0;
}